package test1;

import java.util.Scanner;

public class test2 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String str=sc.next();

        StringBuffer buffer=new StringBuffer();
        char[] chars = str.toCharArray();
        for (int i=0;i<chars.length;i++){
            if ('0'<=chars[i]&&chars[i]<='9'){
                buffer.append(chars[i]);
            }
        }
        System.out.println(buffer.toString());
    }
}
